<h4><i class="fa fa-user"></i> <?php echo Yii::t('helpdesk','My Account'); ?></h4><hr>
<?php 
foreach(Yii::app()->user->getFlashes() as $key => $message){
	echo '<div class="'.$key.'"><p>'.$message."</p></div>\n";
}
?>
<form role="form" id="my-account" class="form-horizontal" method="post" autocomplete="off" enctype="multipart/form-data">
<div class="form-group">
	<label class="col-sm-2 control-label" for="user_fullname"><?php echo Yii::t('helpdesk','Full Name'); ?> <span class="red">*</span></label>
    <div class="col-sm-3">
	<input type="text" id="user_fullname" name="user[user_fullname]" class="form-control"  value="<?php echo $user['user_fullname']; ?>" required="" maxlength="128" readonly>
    </div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label" for="user_email"><?php echo Yii::t('helpdesk','Email'); ?> <span class="red">*</span></label>
    <div class="col-sm-3">
	<input type="email" id="user_email" name="user[user_email]" class="form-control" value="<?php echo $user['user_email']; ?>"  required="" maxlength="128" readonly>
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label" for="address"><?php echo Yii::t('helpdesk','Address'); ?></label>
    <div class="col-sm-3">
	<input type="text" id="address" name="address" class="form-control" value="<?php echo $profile['profile_address']; ?>"  maxlength="128">
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label" for="phone"><?php echo Yii::t('helpdesk','Phone'); ?></label>
    <div class="col-sm-3">
	<input type="text" id="phone" name="phone" class="form-control" value="<?php echo $profile['profile_phone']; ?>"  maxlength="50">
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label" for="avatar"><?php echo Yii::t('helpdesk','Avatar'); ?></label>
    <div class="col-sm-3">
	<input type="file" id="avatar" name="avatar">
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label" for="user_password"><?php echo Yii::t('helpdesk','Password'); ?></label>
    <div class="col-sm-3">
	<input type="password" placeholder="<?php echo Yii::t('helpdesk','Minimum'); ?> 5 <?php echo Yii::t('helpdesk','characters'); ?>" value="" id="user_password" name="user_password" class="form-control" autocomplete="off" maxlength="128">
    </div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label" for="re_password"><?php echo Yii::t('helpdesk','Retype password'); ?></label>
    <div class="col-sm-3">
	<input type="password" placeholder="<?php echo Yii::t('helpdesk','Minimum'); ?> 5 <?php echo Yii::t('helpdesk','characters'); ?>" value="" id="re_password" name="re_password" class="form-control" autocomplete="off" maxlength="128">
    </div>
</div>
<div class="form-group">
	<div class="col-sm-offset-2 col-sm-6">
   		<span style="color:red; font-style:italic; font-size:12px;"><?php echo Yii::t('helpdesk','Leave password blank if dont want to change'); ?></span>
	</div>
</div>
<div class="form-group">
	<div class="col-sm-offset-2 col-sm-6">
	<div class="checkbox">
    <label>
      <input type="checkbox" <?php if(!empty($profile['profile_allow_notify'])):?>checked=""<?php endif; ?> value="1" name="notification"> <?php echo Yii::t('helpdesk','Receive email notification from helpdesk?'); ?> [<i class="fa fa-question tt" title="<?php echo Yii::t('helpdesk', 'Uncheck if you don\'t want to receive notification from helpdesk'); ?>"></i>]
    </label>
	</div>
	</div>
</div>

<div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <input type="submit" class="btn btn-primary btn-large" value="<?php echo Yii::t('helpdesk','Update'); ?>">
    </div>
</div>
</form>
<script type="text/javascript">
	$(document).ready(function(){
		$('#my-account').validate({
			rules: {
				user_password: {
					noSpace: true,
					minlength: 5
				},
				re_password: {
					equalTo: "#user_password"
				}
			}
		});
		
		$.validator.addMethod("noSpace", function(value, element) {
			return !/\s/g.test(value);
		}, "this field requires no space");
	});
</script>